import api from "../../utils/api_util";
import baseUtil from "../../utils/base_util";

const app = getApp();
Page({
    data: {
        StatusBar: app.globalData.StatusBar,
        CustomBar: app.globalData.CustomBar,
        MsgList: [],
    },
    onLoad: function () {
        this.getPublicMsg();
    },
    //公告
    getPublicMsg: function () {
        let that = this;
        api.wxRequest.apiRequest(that, api.urls.informationList, {
            method: 'GET',
            data: {
                categoryId: 4,
                position: '',
                pageNumber: 1,    //每页条数
                pageSize: 100,    //每页条数
            },
            success: function (res) {

                res.data.rows.forEach(function (item, i) {
                    item.createTime = baseUtil.formatDateTime(item.createTime)
                })
                console.log('data:', res.data.rows);
                that.setData({
                    MsgList: res.data.rows
                })
            },
        })
    },
})